cmake_minimum_required(VERSION 3.19)
project(vtkHelloWorld LANGUAGES CXX)


find_package(Qt6 REQUIRED COMPONENTS Core Widgets )

qt_standard_project_setup()

qt_add_executable(vtkHelloWorld
    WIN32 MACOSX_BUNDLE
    main.cpp
    mainwindow.cpp
    mainwindow.h
    mainwindow.ui
    vtkfilterdemo.h vtkfilterdemo.cpp vtkfilterdemo.ui
)

target_link_libraries(vtkHelloWorld
    PRIVATE
        Qt::Core
        Qt::Widgets
)
set(VTK_DIR "C:/Program Files (x86)/VTK")
find_package(VTK REQUIRED COMPONENTS
    CommonCore
    CommonDataModel
    FiltersSources
    GUISupportQt
    RenderingCore
    RenderingOpenGL2
    InteractionStyle
)

find_package(Qt6 REQUIRED COMPONENTS OpenGL)
target_link_libraries(vtkHelloWorld PRIVATE Qt6::OpenGL ${VTK_LIBRARIES})




include(GNUInstallDirs)

install(TARGETS vtkHelloWorld
    BUNDLE  DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

qt_generate_deploy_app_script(
    TARGET vtkHelloWorld
    OUTPUT_SCRIPT deploy_script
    NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
